#include <iostream>
#include <string>
using namespace std;

bool match(char a, char b) {
    return (a == '(' && b == ')') || (a == '[' && b == ']') || (a == '{' && b == '}') || (a == '<' && b == '>');
}

bool opening(char a) {
    return (a == '(') || (a == '{') || (a == '[') || (a == '<');
}

int main() {
    string s, banka;
    cin >> s;
    for (auto c : s) {
        if (banka.length() == 0) {
            banka.push_back(c);
        } else {
            char a = banka[banka.length() - 1];
            if (match(a, c)) {
                banka.pop_back();
            } else if (opening(c)) {
               banka.push_back(c); 
            }
        }
    }
    cout << (banka.length() == 0 ? "yes" : "no");
    return 0;
}